﻿@model myFinance.Models.Tarefa
@{
	ViewBag.Title = "Tarefas - Cadastro";
}
<!DOCTYPE html>
<html>
<head>
    <title>Cadastro</title>
    @if (false)
    {
        <script type="text/javascript" src="../../Scripts/jquery-1.6.4-vsdoc.js"></script>
        <script type="text/javascript" src="../../Scripts/jquery.validate-vsdoc.js"></script>
        <script type="text/javascript" src="../../Scripts/jquery.validate.js"></script>
    }
</head>
<body>
    @using (Html.BeginForm("Cadastro", "Tarefa", FormMethod.Post))
    {
        @Html.ValidationSummary(true)
        <fieldset>
            <legend>Tarefa</legend>
            @Html.HiddenFor(model => model.Id)
            <div class="editor-label">
                @Html.LabelFor(model => model.Nome)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Nome)
                @Html.ValidationMessageFor(model => model.Nome)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.DataCadastro)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.DataCadastro)
                @Html.ValidationMessageFor(model => model.DataCadastro)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.DataTarefa)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.DataTarefa)
                @Html.ValidationMessageFor(model => model.DataTarefa)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Descricao)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Descricao)
                @Html.ValidationMessageFor(model => model.Descricao)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Concluida)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Concluida)
                @Html.ValidationMessageFor(model => model.Concluida)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.ProjetoId)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.ProjetoId)
                @Html.ValidationMessageFor(model => model.ProjetoId)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.AvisarPorEmail)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.AvisarPorEmail)
                @Html.ValidationMessageFor(model => model.AvisarPorEmail)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.AvisarPorPopUp)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.AvisarPorPopUp)
                @Html.ValidationMessageFor(model => model.AvisarPorPopUp)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.PessoaId)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.PessoaId)
                @Html.ValidationMessageFor(model => model.PessoaId)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.HoraInicio)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.HoraInicio)
                @Html.ValidationMessageFor(model => model.HoraInicio)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.HoraFim)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.HoraFim)
                @Html.ValidationMessageFor(model => model.HoraFim)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.Codigo)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Codigo)
                @Html.ValidationMessageFor(model => model.Codigo)
            </div>
            <div class="editor-label">
                &nbsp;
            </div>
            <div class="editor-field" style="float: right; padding-right: 100px; margin-top: 15px;">
                <input type="submit" value="Gravar" />
                <input type="button" value="Cancelar" id="cancelar" />
            </div>
        </fieldset>
    }
    <script type="text/javascript">
        $(function () {
            $.validator.unobtrusive.parse($('#formtarefa'));
            $('.datepicker').mask('99/99/9999');
            loadPage();
            if ('@Model.Id' == 0) {
                $('#DataVencimento').val('');
            }
               hideLoading();
            $('#DataVencimento').focus();
        });        
        $('#cancelar').click(function () {
        	showLoading();
        	window.location.href = '@Url.Action("Index", "Tarefa")';
        });
	</script>
</body>
</html>
